import {request} from "./request";

export function getAnswer(answer_id) {
  return request({
    method: "get",
    url: `router.php?s=answer/${answer_id}/`
  })
}

export function getAnswerComments(answer_id) {
  return request({
    method: "get",
    url: `router.php?t=answer/getComments/${answer_id}/`
  })
}

export function postAnswer(obj) {
  return request({
    method: "post",
    url: `router.php?s=answer/`,
    data: JSON.stringify(obj)
  })
}

export function putAnswer(answer_id, obj) {
    return request({
      method: "put",
      url: `router.php?s=answer/${answer_id}/`,
      data: JSON.stringify(obj)
    })
}
